<!-- 我的-我的事项 -->
<template>
  <div class="container">
      <template v-if="!loading && list.length">
          <div class="item" v-for="(item, index) in list" @click="toPage('pages/mime/itemDetail', { id: item.id })" :key="index">
              <div class="title">{{item.content}}</div>
              <div class="card-time" style="display: flex; justify-content: space-between;">
                <div>申请时间：{{item.createDate}}</div>
                <div :style="{ color: item.replyStatus == 0 ? '#E6A23C': item.replyStatus == 1 ? '#67C23A' : '#409EFF'}">{{item.replyStatusName}}</div>
              </div>
          </div>
      </template>
      <Empty v-if="!loading && !list.length"></Empty>
  </div>
</template>
<script>
import Empty from "../../components/Empty.vue";
import { getgetMassAgentByOpenIdList } from "../../api/tuan";
import { mapState } from "vuex";
export default {
  components: { Empty },
  data() {
      return {
          loading: false,
          list: [],
          title: "",
      };
  },
  computed: {
    ...mapState(["openId"]),
  },
  onShareAppMessage() {},
  onLoad() {
    this.loading = true;
    wx.showLoading({
        title: "加载中...",
    });
    getgetMassAgentByOpenIdList(this.openId).then((res) => {
        this.list = res.data;
        wx.hideLoading();
        this.loading = false;
    });
  },
  methods: {
    toPage(url, params) {
      this.$u.route({ url, params });
    },
  },
};
</script>
<style scoped lang="scss">
@import "../../assets/scss/common.scss";

.container {
  min-height: 100vh;
  background-color: #fff;
  box-sizing: border-box;
  padding: 5px 15px;
  .item {
      border-bottom: 1px solid #efefef;
      padding: 10px 5px;
      &:last-child {
          border: none;
      }
      .title {
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 1;
          overflow: hidden;
          margin-bottom: 5px;
          color: #0c92ff;
      }
      .time {
          color: $color_secondary-text;
      }
  }
}
</style>
